cmake_minimum_required(VERSION 3.5)

project(service_box)
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})

SET(CMAKE_CXX_FLAGS "-m64 -O2 -g -std=c++17 -DUSE_STATIC_LIB -DTHREADED -DCURL_STATICLIB -Wall -Wno-unused-variable -fnon-call-exceptions")
set(CMAKE_CXX_COMPILER "g++")
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES(
  ${PROJECT_SOURCE_DIR}/../thirdparty/zookeeper/include
  ${PROJECT_SOURCE_DIR}/../thirdparty/curl/include
  /usr/local/include
)

aux_source_directory(argument SRC_FILES)
aux_source_directory(box SRC_FILES)
aux_source_directory(config SRC_FILES)
aux_source_directory(detail SRC_FILES)
aux_source_directory(detail/zookeeper SRC_FILES)
aux_source_directory(util SRC_FILES)
aux_source_directory(util/websocket SRC_FILES)
aux_source_directory(util/lua SRC_FILES)
aux_source_directory(util/lua/argument SRC_FILES)
aux_source_directory(util/lua/config SRC_FILES)
aux_source_directory(util/lua/redis SRC_FILES)
aux_source_directory(util/lua/time SRC_FILES)
aux_source_directory(util/lua/http SRC_FILES)
aux_source_directory(util/lua/console SRC_FILES)
aux_source_directory(../thirdparty/jsoncpp SRC_FILES)
aux_source_directory(../thirdparty/kconfig/kconfig/internal SRC_FILES)
aux_source_directory(../thirdparty/klogger/klogger/internal SRC_FILES)
aux_source_directory(../thirdparty/knet/knet SRC_FILES)
aux_source_directory(../thirdparty/http_parser SRC_FILES)
aux_source_directory(../thirdparty/lua/src SRC_FILES)
aux_source_directory(../thirdparty/sha1/ SRC_FILES)
aux_source_directory(../thirdparty/base64/ SRC_FILES)

add_library(
	service_box
	${SRC_FILES}
)
